package com.yang.code_sample.performance_count.service;

import com.yang.code_sample.performance_count.entity.RequestInfo;

import java.util.List;
import java.util.Map;

/**
 * @Description: 统计接口类
 * @Author: 杨 强
 * @CreateTime: 2022-10-13 16:44
 */
public interface MetricsStorage {
    /**
     * @description: 保存接口请求数据
     * @param: requestInfo 请求数据
     * @return: void
     * @author: 杨 强
     * @createTime: 2022/10/13 16:48
     **/
    void saveRequestInfo(RequestInfo requestInfo);

    /**
     * @description: 获取指定接口+指定时间段的接口请求的数据
     * @param: apiName
     * @param: startTimeInMillis
     * @param: endTimeInMillis
     * @return: java.util.List<com.yang.code_sample.performance_count.RequestInfo>
     * @author: 杨 强
     * @createTime: 2022/10/13 16:48
     **/
    List<RequestInfo> getRequestInfos(String apiName, long startTimeInMillis, long endTimeInMillis);

    /**
     * @description: 获取所有接口的请求数据
     * @param: startTimeInMillis
     * @param: endTimeInMillis
     * @return: java.util.Map<java.lang.String,java.util.List<com.yang.code_sample.performance_count.RequestInfo>>
     * @author: 杨 强
     * @createTime: 2022/10/13 16:49
     **/
    Map<String, List<RequestInfo>> getRequestInfos(long startTimeInMillis, long endTimeInMillis);
}
